<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>01-fetch</title>
</head>
<body>

 <div id="app">
   <button @click="handle()">获取影片信息</button>
   <ul>
     <li v-for="data in msg">
       {{data.name}}
       <img :src="data.url" alt="">
     </li>
   </ul>
 </div>
 <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.11/vue.js"></script>
 <script>
   const vm=new Vue({
     el:"#app",
     data:{
       msg:[],
     },
     methods:{
       handle(){
         fetch("./package.json").then(res=> {
           return res.json()
         }).then(res=>{
           this.msg=res.data
         });
       }
     }
   })
 </script>
</body>
</html>